var textStr = ""

function nodeInfoModFn(type) {
    let typeStr = "";
    let topClassStr = "tableDiv";//0:tableDiv 1:apiDiv  >=2:strDiv
    let numType = type - 0;
    let strObjList = {itemType:"类型",objIsExist:"对象是否存在",tableEname:"表英文名",tableCname:"表中文名",dbEngineName:"数据引擎名称",itemSchema:"逻辑分区名称",projectName:"工作空间标识",apiName:"API名称",modelId:"服务单元标识",apiStatus:"API状态",apiDesc:"API描述",fieldEname:"字段英文名",fieldCname:"字段中文名",fieldType:"字段类型",fieldLen:"字段长度",pageEname:"页面英文名",pageEname2:"数据集名称",pageCname:"页面中文名",desc:"描述",isAuth:"是否授权",isPublic:"是否公开",isOn:"是否上线",dataNum:"已同步记录数(条)",dataSize	:"已同步数据大小(B)",failedNum:"写入失败记录数(条)",dbIp:"数据库ip",dbPort:"数据库端口",sqlState:"执行的sql语句",sqlCount:"配置的sql语句条数",affectRowsCount:"影响的行数和",affectRowsStr:"影响的行数列表",originalName:"源端名称",originalDesc:"描述",iplatType:"iplat类型",iplatHost:"iplat地址"}
    let keyList = []
    if(numType == 0){
        keyList = ["tableEname","tableCname","dbEngineName","itemSchema","itemType"]
    }else if(numType == 1){
        topClassStr = "apiDiv"
        keyList = ["apiName","modelId","apiStatus","apiDesc","projectName","itemType"]
    }else if(numType ==2){
        topClassStr = "strDiv"
        keyList = ["fieldEname","fieldCname","fieldType","fieldLen","itemType"]
    }else if(numType >2&&numType <6){
        topClassStr = "strDiv"
        keyList = ["pageEname","pageCname","desc","isAuth","isPublic","isOn","projectName","itemType"]
    }else if(numType ==6){
        topClassStr = "strDiv"
        keyList = ["pageEname2","isAuth","isPublic","projectName","itemType"]
    }else if(numType ==7){//源端表
        topClassStr = "strDiv"
        keyList = ["originalName","originalDesc","dbEngineName","itemSchema","itemType"]
    }
    else if(numType ==8){//iplatBB服务
        topClassStr = "strDiv"
        keyList = ["originalName","originalDesc","iplatType","iplatHost","itemType"]
    }else if(numType ==9){//API服务
        topClassStr = "strDiv"
        keyList = ["originalName","originalDesc","itemType"]
    }

    for (let i = 0; i < keyList.length; i++) {
        let key = keyList[i];
        typeStr+=`<div class="${topClassStr} flex">
                    <span>${strObjList[key]}:</span>
                    <span id="${key}"></span>
                </div>`
    }
    let queryUpAndDownNode =`<div class="${topClassStr} flex-c" data-title="查询上下游">
                    <div onClick="queryNodeUpAndDown()" class="flex-c"><a href="#" >查询对象上下游</a></div>
                </div>`
        queryUpAndDownNode = "";//暂时不开发        
    textStr = `<div class="detailDataBox">
                ${typeStr}
                ${queryUpAndDownNode}
                <svg viewBox="25 25 50 50" class="svgbox">
                    <circle cx="50" cy="50" r="20" fill="none" class="circle"></circle>
                </svg>
            </div>`;
    return textStr
}


export default nodeInfoModFn;